/**
 * IPS Social Suite 4
 * (c) 2013 Invision Power Services - http://www.invisionpower.com
 *
 * images.js - Images JS controller
 *
 * Author: Invisionify.com
 */
;( function($, _, undefined){
	"use strict";

	ips.controller.register('fxpages.images', {

		initialize: function () {
			this.setup();
		},

		setup: function () {
			var items = this.scope.find("img.ipsImage");
          	items.each( function () {
              $(this).closest('p').wrap('<div class="fxPages_image"></div>');
				if ($(this).attr('alt')) {
					$(this).parent().after('<span class="fxPages_caption">' + $(this).attr('alt') + '</span>');
              	}
			});

		}
	});
}(jQuery, _));

        